<?php use_stylesheet('teams.css') ?>
<h1>Liste des groupes</h1>

<?php foreach ($pronos_groups as $i => $pronos_group): ?>
<a href="<?php echo url_for('group/show?id='.$pronos_group->getId()) ?>"><h1><?php echo $pronos_group->getName() ?></h1></a>
<div id="teams">
<table class="teams">
<tr align="center">
	<th colspan="2">Equipes</th>
	<th>Jou&eacute;s</th>
	<th>Gagn&eacute;s</th>
	<th>Nuls</th>
	<th>Perdus</th>
	<th>BP</th>
	<th>BC</th>
	<th>+/-</th>
	<th><b>Pts</b></th>
	
</tr>
    <?php 
		$teams = $pronos_group->getTeams();
		$standings = new ArrayObject();
	
		foreach($teams as $team){
			$standing = $team->getStanding();
			$standings->Append($standing);
		}
		unset($standing);
		$standings->uasort('cmp');
	
		$i=0;
		foreach ($standings as  $standing): 
			$i++;
			$pronos_team = $standing->getPronosTeam();
	?>
	    <tr class="<?php echo fmod($i, 2) ? 'even' : 'odd' ?>">
		<td><img src="/pronos/images/teams/<?php echo strtolower($pronos_team->getCode()) ?>.gif" /></td>
		<td class="position">
			<a href="<?php echo url_for('team/show?id='.$pronos_team->getId()) ?>">
				<?php echo $pronos_team->getName() ?>
			</a>
		</td>
		<td class="position" align="center"><?php echo $standing->getNbPlayed() ?></td>
		<td class="position" align="center"><?php echo $standing->getNbWon() ?></td>
		<td class="position" align="center"><?php echo $standing->getNbNul() ?></td>
		<td class="position" align="center"><?php echo $standing->getNbLost() ?></td>
		<td class="position" align="center"><?php echo $standing->getNbBP() ?></td>
		<td class="position" align="center"><?php echo $standing->getNbBC() ?></td>
		<td class="position" align="center"><?php echo $standing->getNbBP() - $standing->getNbBC() ?></td>
		<td class="position" align="center"><b><?php echo $standing->getNbPts() ?></b></td>
		</tr>
	<?php endforeach ?>
</table>
</div>
<br/>
<?php endforeach ?>